package com.landliu.idea.plugin.cgpt.action;

import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogBuilder;
import com.landliu.idea.plugin.cgpt.service.ProjectGeneratorService;
import com.landliu.idea.plugin.cgpt.service.impl.ProjectGeneratorServiceImpl;
import com.landliu.idea.plugin.cgpt.ui.ORMSettingsUI;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * @author Liu XiaoJun
 * @since 2025-06-06
 */
public class CodeGenerateAction extends AnAction {

    @Override
    public void actionPerformed(AnActionEvent e) {
        Project project = e.getRequiredData(CommonDataKeys.PROJECT);

        DialogBuilder builder = new DialogBuilder(project);
        builder.title("CGPT代码生成工具");
        builder.removeAllActions();

        // 创建并显示你的GUI Form
        ORMSettingsUI configurable = new ORMSettingsUI(project, builder);

        builder.centerPanel(configurable.getMainPanel());
        builder.show();

    }
}
